<template>
    <div class="banner-wrap">
        <div class="banner" @click="handleBannerClick">
            <img :src="bannerImg" alt="">
            <div class="banner-info">
                <div class="banner-title">{{sightName}}</div>
                <div class="banner-icon"><span class="iconfont">&#xe64a;</span>{{this.gallaryImgs.length}}</div>
            </div>
        </div>
        <fade-animation>
            <common-gallery
                :gallaryImgs="gallaryImgs"
                v-show="showGallery"
                @close="handleGalleryClose"
            ></common-gallery>
        </fade-animation>
    </div>
</template>

<script>
import commonGallery from '@/common/gallery/Gallery'
import FadeAnimation from '@/common/fade/Fade'
export default {
  name: 'DetailBanner',
  components: {
    commonGallery,
    FadeAnimation
  },
  props: {
    sightName: String,
    bannerImg: String,
    gallaryImgs: Array
  },
  data () {
    return {
      showGallery: false
    }
  },
  methods: {
    handleBannerClick () {
      this.showGallery = true
    },
    handleGalleryClose () {
      this.showGallery = false
    }
  }
}
</script>

<style lang="stylus" scoped>
@import '~s/varibles.styl'
.banner-wrap
    .banner
        position relative
        overflow hidden
        height 0
        padding-bottom 55%
        img
            width 100%
        .banner-info
            display flex
            position absolute
            left 0
            right 0
            bottom 0
            line-height .6rem
            color #fff
            background-image linear-gradient(top, rgba(0,0,0,0), rgba(0,0,0,0.8))
            .banner-title
                flex 1
                font-size .32rem
                padding 0 .2rem
            .banner-icon
                padding 0 .3rem
                height .32rem
                line-height .32rem
                border-radius .2rem
                background rgba(0,0,0,0.6)
                font-size .24rem
                margin-top .14rem
                margin-right .2rem
                .iconfont
                    font-size .12rem
                    margin-right .06rem
</style>
